using ApexCharts;
using BlazorDownloadFile;
using Blazored.Toast;
using Blazorise;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
using Cropper.Blazor.Extensions;
using CurrieTechnologies.Razor.SweetAlert2;
using Havit.Blazor.Components.Web;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.JSInterop;
using MudBlazor.Services;
using Neuroglia.Blazor.JsonForms;
using Radzen;
using System.Dynamic;
using System.Reflection;
using System.Text;
using System.Web;

namespace BlazorSample
{
    public class Program
    {
        public static async Task Main(string[] args)
        {
            var builder = WebAssemblyHostBuilder.CreateDefault(args);
            builder.RootComponents.Add<App>("#app");
            builder.RootComponents.Add<HeadOutlet>("head::after");

            builder.Services.AddSingleton<JsonFormsJsInterop>();

            builder.Services.AddRadzenComponents();

            WebAssemblyHost host = builder.Build();
            {
                var unhandledExceptionProvider = new UnhandledExceptionProvider();
                builder.Logging.AddProvider(unhandledExceptionProvider);

                unhandledExceptionProvider.Log += (LogLevel, exception) =>
                {
                   
                };
            }

            builder.Services.AddBootstrapBlazor();

            builder.Services.AddBlazoredToast();

            builder.Services.AddBlazorise(options =>
            {
                options.Immediate = true;
            }).AddBootstrap5Providers().AddFontAwesomeIcons();

            builder.Services.AddAntDesign();

            builder.Services.AddMudServices();

            builder.Services.AddHxServices();

            builder.Services.AddSweetAlert2();

            builder.Services.AddBlazorDownloadFile(ServiceLifetime.Scoped);

            builder.Services.AddCropper();


            builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

            await builder.Build().RunAsync();
        }
    }
}
